using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using OVS.BusinessObjects;
using OVS.DAL;

namespace OVS.BLL
{
	public partial class AlertBLL
	{
		private AlertDAO _AlertDAO;

		public AlertDAO AlertDAO
		{
			get { return _AlertDAO; }
			set { _AlertDAO = value; }
		}

		public AlertBLL()
		{
			AlertDAO = new AlertDAO();
		}
		public List<Alert> GetAlerts()
		{
			try
			{
				return AlertDAO.GetAlerts();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Alert GetAlert(int aler_id)
		{
			try
			{
				return AlertDAO.GetAlert(aler_id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddAlert(Alert oAlert)
		{
			try
			{
				return AlertDAO.AddAlert(oAlert);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateAlert(Alert oAlert)
		{
			try
			{
				return AlertDAO.UpdateAlert(oAlert);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveAlert(Alert oAlert)
		{
			try
			{
				return AlertDAO.RemoveAlert(oAlert);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveAlert(int aler_id)
		{
			try
			{
				return AlertDAO.RemoveAlert(aler_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Alert> GetAlertsOfCamera(int came_id)
		{
			try
			{
				return AlertDAO.GetAlertsOfCamera(came_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public Camera GetCameraOfAlert(int came_id)
		{
			try
			{
				return AlertDAO.GetCameraOfAlert(came_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Alert> GetAlertsOfVideo(int vide_id)
		{
			try
			{
				return AlertDAO.GetAlertsOfVideo(vide_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public Video GetVideoOfAlert(int vide_id)
		{
			try
			{
				return AlertDAO.GetVideoOfAlert(vide_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Alert> GetAlertsOfImage_Details(int imde_id)
		{
			try
			{
				return AlertDAO.GetAlertsOfImage_Details(imde_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public Image_Details GetImage_DetailsOfAlert(int imde_id)
		{
			try
			{
				return AlertDAO.GetImage_DetailsOfAlert(imde_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Alert> GetAlertsOfUser(int user_id)
		{
			try
			{
				return AlertDAO.GetAlertsOfUser(user_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public User GetUserOfAlert(int user_id)
		{
			try
			{
				return AlertDAO.GetUserOfAlert(user_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Alert> DeserializeAlerts(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Alert>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeAlerts(string Path, List<Alert> Alerts)
		{
			try
			{
				GenericXmlSerializer<List<Alert>>.Serialize(Alerts, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
